package com.tengju.user.domain.model.survey;

import lombok.Getter;

import java.util.Arrays;

@Getter
public enum SurveyTypeEnum {
    SURVEY(1,"问卷"),
    EXAM(2,"考试");

    private Integer code;
    private String desc;

    SurveyTypeEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static SurveyTypeEnum parseByCode(Integer code) {
        return Arrays.stream(SurveyTypeEnum.values())
                .filter(k -> k.getCode().equals(code))
                .findFirst().orElse(null);
    }

}
